package com.appspot.entourage.ui.server;

import java.util.ArrayList;
import java.util.List;

import org.junit.Assert;

import com.appspot.entourage.common.NamedLink;
import com.appspot.entourage.explorer.Explorer;
import com.appspot.entourage.webpageparser.WebPageParser;

public class ServerManager {
	
	Explorer explorer;
	
	public ServerManager() {
		explorer = new Explorer();
	}
	
	/**
	 * Get method for last log message
	 * @return last log message by the url key
	 * @author Ercument ESER <ercueser{ at }gmail.com>
	 */
	public String getLastLogMessage(String url){
		return null;
	}
	
	/**
	 * Add the url to the jobs list to be explored in the db
	 * @return none
	 * @author Ercument ESER <ercueser{ at }gmail.com>
	 * @param maxRadius 
	 */

	public void addJob(int maxRadius, String url) {
		
		
	}
	
	/**
	 * Run the task when requested by task queue
	 * @return none
	 * @author Ercument ESER <ercueser{ at }gmail.com>
	 * @param maxRadius 
	 * @throws Exception 
	 */

	
	public void runJob(int maxRadius, String url) throws Exception{
		
		if(maxRadius > 0 && url!=null)
			explorer.start(url, maxRadius);
		else
			explorer.continueTo();
		
		
		
	}
	
	/**
	 * Get Relations as String for Graph
	 * @return none
	 * @author String ESER <ercueser{ at }gmail.com>
	 * @param maxRadius 
	 */

	public String getRelationsForGraph(String url) {
		return "test string";
		
	}

}
